<template>
	<view class="content">
		<view class="section-2">
			<view class="section-body">
				<!-- <image class="type1" v-if="type == '1'" src="./1.png"></image> -->
				<!-- <image class="type8" v-if="type == '8'" src="./8.png"></image> -->
				<view class="title">项目数量：{{quantity}}</view>
				<view class="list">
					<view class="item" v-for="(item, index) in list" :key="index">
						<view class="inlineItem">
							<view class="name">
								<span class="inline">项目名称：</span>
								{{ item.project_name }}
							</view>
							<view v-if="type==2||type==5">
								<view class="time">
									<text>内控开工时间：{{ item.internal_control_start_time? item.internal_control_start_time.substring(0, 10) : '-' }}</text>
									<text>内控投产时间：{{ item.internal_control_prod_time? item.internal_control_prod_time.substring(0, 10) : '-' }}</text>
								</view>
							</view>
							<view v-else>
								<view class="time">
									<text>计划开工时间：{{ item.kg_time? item.kg_time.substring(0, 10) : '-' }}</text>
									<text>计划投产时间：{{ item.tc_time? item.tc_time.substring(0, 10) : '-' }}</text>
								</view>
								<view class="dotime">
									<text>实际开工时间：{{ item.kg_time_real? item.kg_time_real.substring(0, 10) : '-' }}</text>
									<text>实际投产时间：{{ item.tc_time_real? item.tc_time_real.substring(0, 10) : '-' }}</text>
								</view>
							</view>

						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		AnalysisProjectInfo
	} from '@/api/statistics.js'
	export default {
		data() {
			return {
				type: '',
				quantity: '',
				list: []
			}
		},
		methods: {},
		onLoad(data) {
			console.log(data, '类型')
			if (data.type) {
				this.type = data.type
				AnalysisProjectInfo({
					type: this.type
				}).then(res => {
					this.quantity = res.data.data.length
					this.list = res.data.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.section-2 {
		width: 100%;
		background: #2e5efe;

		.section-body {
			width: 100%;
			padding-top: 50rpx;
			border-top-left-radius: 50rpx;
			border-top-right-radius: 50rpx;
			background-color: #fff;
			overflow: hidden;

			.title {
				margin-left: 51.8rpx;
				font-size: 20px;
				color: #2e5eff;
				font-weight: bolder;
			}

			.list {
				width: 100%;
				box-sizing: border-box;
				padding: 0 35rpx;
				padding-top: 40rpx;

				.item {
					width: 100%;
					border-radius: 30rpx;
					@include common-box-shadow;
					margin-bottom: 40rpx;
					box-sizing: border-box;
					padding: 30rpx 20rpx;
					font-size: 14px;
					padding-left: 30rpx;

					.name {
						.inline {
							color: #2c5cff;
						}
					}

					.time {
						margin-top: 20rpx;
						display: flex;
						justify-content: space-between;
						font-size: 12px;
						color: #888388;

						text {
							width: 400rpx;
						}
					}

					.dotime {
						margin-top: 20rpx;
						display: flex;
						justify-content: space-between;
						font-size: 12px;
						color: #888388;

						text {
							width: 400rpx;
						}
					}
				}
			}
		}
	}
</style>
